<template>
  <div>
    <el-dialog :title="title"
     v-model="dialogVisible" 
     @close="close"
     width="20%">
      <slot></slot>
    </el-dialog>
  </div>
</template>

<script>
import { reactive,ref, watch } from "vue";
export default {
  components: {},
  props: {
    title: {
      type: String,
    },
    flag: Boolean,
  },
  setup(props,{emit}) {
    console.log(props);
    const dialogVisible = ref(false)
    let state = reactive({
      title: props.title,
      isshow: props.isshow,
    });
    function close(){
      dialogVisible.value = false;
      emit("flagFun", false);
    };
   watch(() => {
      dialogVisible.value = props.flag;
    });
    return { 
    state,
    close,
    dialogVisible
    };
  },
};
</script>
<style lang="scss" scoped>
.wrapper {
}
</style>